package unit;

import java.util.ArrayList;

public class Node {
    private final int index;
    private final String type;
    private final ArrayList<Node> children = new ArrayList<>();

    public Node(int index, String type) {
        this.index = index;
        this.type = type;
    }

    public void addChild(Node child) {
        this.children.add(0, child);
    }

    public void addChildren(ArrayList<Node> children) {
        this.children.addAll(children);
    }

    public int getIndex() {
        return index;
    }

    public String getType() {
        return type;
    }

    public ArrayList<Node> getChildren() {
        return children;
    }
}
